<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="pt-br" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core"
>

<head>
<title>Agenda Contatos</title>
</head>

<body>
	<f:view>
		<h:form>
			<h:outputText value="Nome: " />
			<h:inputText value="#{agendaContatoBean.contato.nome}"/>

			<br />

			<h:outputText value="Endereço: " />
			<h:inputText value="#{agendaContatoBean.contato.endereco }" />

			<br />

			<h:outputText value="Sexo: " />
			<h:inputText value="#{agendaContatoBean.contato.sexo }" />

			<br />

			<h:commandButton actionListener="#{agendaContatoBean.incluirContato}" value="Incluir" />

			<br />
			<br />

			<h:dataTable var="obj" value="#{agendaContatoBean.contatos }" border="1" width="100%">

				<h:column>
					<f:facet name="header">
						<h:outputText value="Nome" />
					</f:facet>
					<h:outputText value="#{obj.nome}" />
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Endereço" />
					</f:facet>
					<h:outputText value="#{obj.endereco}" />
				</h:column>

				<h:column>
					<f:facet name="header">
						<h:outputText value="Sexo" />
					</f:facet>
					<h:outputText value="#{obj.sexo}" />
				</h:column>

			</h:dataTable>
		</h:form>
	</f:view>
</body>
</html>